Reintroduce minimal AbstractNetworkIterator interface code to express BP
#15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR expresses the BP code in terms of the
SweepIteratorandRegionIteratorinterface. It also defines a subtype ofAbstractProblemto host the BP relevant data structures (the cache and the diff).The
set_default_kwargssystem has also been simplified, instead being defined in terms of a singledefault_algorithmfunction.I think certain aspects could be improved depending on how "radical" we wish to be; this was sort of a "minimal viable example" of putting BP in
SweepIterator. For example, theAlgorithm"bp"type seems a bit redundant/is not used to its full potential.The first BP test (on MPS) passes always, but the test on the comb fails as the difference between the two values is sometimes slightly more than the tolerance
1e-14(tensors used are random). This should be exact to machine precision after a single iteration, no?